home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 13 / AMIGAplus Sonderheft 13 (1998)(ICP)(DE)[!].iso / rexx / loaddesktop.bed < prev    next >
Text File  |  1997-12-03  |  1KB  |  76 lines

  1. /*
  2. ** $VER: SaveDesktop.bed 1.0 (02.01.96)
  3. **
  4. ** Load the layout of the desktop fromn a file
  5. **
  6. ** Written by Marco Negri
  7. */
  8.  
  9. OPTIONS RESULTS
  10. OPTIONS FAILAT 11
  11. PARSE ARG name
  12.  
  13. IF name = "" THEN DO
  14.     RequestFile 'TITLE "Select File to Load as Layout"' 'PATTERN "#?.layout"' 'BED:Support/'
  15.     IF RC ~= 0 THEN EXIT
  16.     name = RESULT
  17. END
  18.  
  19. ADDRESS BED
  20.  
  21. IF Open(file,name,READ) THEN DO
  22.  
  23.     DO FOREVER
  24.         name = ReadLn(file)
  25.  
  26.         IF name = "" THEN EXIT
  27.  
  28.         window = ReadLn(file)
  29.         coord = ReadLn(file)
  30.         a = ReadLn(file)
  31.  
  32.         OpenDoc 'WINDOW=' || window || " " || name
  33.         ADDRESS VALUE RESULT
  34.         Move coord
  35.     END
  36. END
  37.  
  38. /*
  39. IF Open(save,name,WRITE) THEN DO
  40.     DO WHILE docs ~= ""
  41.         PARSE VAR docs '"'.'"' port docs
  42.  
  43.         ADDRESS VALUE port
  44.  
  45.         GetFilePath
  46.         WriteLn(save,RESULT)
  47.  
  48.         GetWindowInfo
  49.         PARSE VAR RESULT icon x1 y1 w1 h1 .
  50.  
  51.         IconifyWindow TOGGLE
  52.  
  53.         GetWindowInfo
  54.         PARSE VAR RESULT . x2 y2 w2 h2 .
  55.  
  56.         IconifyWindow TOGGLE
  57.  
  58.         IF icon = ON THEN DO
  59.             str = x2 || '/' || y2 || '/' || w2 || '/' || h2 || '/' || x1 || '/' || y1 || '/ICONIFY'
  60.         END; ELSE DO
  61.             str = x1 || '/' || y1 || '/' || w1 || '/' || h1 || '/' || x2 || '/' || y2
  62.         END
  63.         WriteLn(save,str)
  64.  
  65.         GetCursorPos
  66.         str = WORD(RESULT,1) WORD(RESULT,2)
  67.         WriteLn(save,str)
  68.  
  69.         WriteLn(save,"")
  70.  
  71.         i = i+1
  72.     END
  73.  
  74.     Close(save)
  75. END
  76. */